﻿using LogionDemo.Common.Interfaces;
using LogionDemo.Common.UserEventArgs;

namespace LogionDemo.Models
{
	internal class LoginStatusObserver : ISimpleSubscriber<LoginStatusChangedEventArgs>
	{
		public void OnNext(LoginStatusChangedEventArgs args)
		{
			string message = args.IsLoggedIn ? $"用户{args.UserToken.UserName}登录，时间：{DateTime.Now}" : $"用户{args.UserToken.UserName}注销，时间：{DateTime.Now}";
			Console.WriteLine(message);
		}
	}
}